<?=jq_form_remote_tag(array(
  "update"=>"usuario_horario",
  "url"=>"usuarios/guardarHorario",
  "loading"=>"rollLoading('usuario_horario')",

))?>
<?=input_hidden_tag("usuario_id",$usuario_id)?>
<fieldset>
  <legend>Horario Semanal</legend>
  <table>
    <thead>
      <tr>
        <th width="100"></th>
        <? foreach ($dias as $dia):?>
        <th width="100"><?=$dia->getNombre()?></th>
        <? endforeach;?>
      </tr>
    </thead>
    <tr>
      <th align="center"><?=__("Desde")?></th>
      <? foreach ($dias as $dia):?>
      <? $aDia = (isset($aDias[$dia->getId()])) ? $aDias[$dia->getId()] : new Horario();?>
      <td align="center">
        <?=select_tag("dia[".$dia->getId()."][i]",options_for_select(FechasDias::createHorario(),$aDia->getInicio(),array("include_blank"=>true)))?>
      </td>
      <? endforeach;?>
    </tr>
    <tr>
      <th align="center"><?=__("Hasta")?></th>
      <? foreach ($dias as $dia):?>
      <? $aDia = (isset($aDias[$dia->getId()])) ? $aDias[$dia->getId()] : new Horario();?>
      <td align="center">
      <?=select_tag("dia[".$dia->getId()."][f]",options_for_select(FechasDias::createHorario(),$aDia->getFin(),array("include_blank"=>true)))?>
      </td>
      <? endforeach;?>
    </tr>
  </table>
  <? include_component("layout","botonSubmit",array("texto"=>"Guardar Horario"));?>
  <div class="texto-alerta">
  <?=__("No se podran cambiar horarios si tiene asignados turnos")?>
  </div>
</fieldset>
</form>
